import axios from './api'
// 角色管理
export const sysRolePage = params => {
  return axios.post('/v1/sysRole/pageQuery', params).then(res => res.data)
}
export const sysRoleGet = params => {
  return axios.get(`/v1/sysRole/get/${params}`).then(res => res.data)
}
export const sysRoleUpdate = params => {
  return axios.put(`/v1/sysRole/update`, params).then(res => res.data)
}
export const sysRoleSave = params => {
  return axios.post(`/v1/sysRole/save`, params).then(res => res.data)
}
export const sysRoleDelete = params => {
  return axios.delete(`/v1/sysRole/delete/${params}`).then(res => res.data)
}

export const sysRoleGetAll = () => {
  return axios.get(`/v1/sysRole/getAll`).then(res => res.data)
}
export const sysRoleGetAllocated = params => {
  return axios.get(`/v1/sysRole/getAllocated/${params}`).then(res => res.data)
}
export const sysUserRoleDelete = params => {
  return axios.post(`/v1/sysRole/deleteRelation`, params).then(res => res.data)
}
export const sysUserRoleSave = params => {
  return axios.post(`/v1/sysRole/saveRelation`, params).then(res => res.data)
}
